<?php

require_once('../include/GeneralTop.php');
require('../include/class/db.php');

if (!$pay_member) {
	die('<div style="text-align:center">Permission denied...</div>');
}

$id = "-1";
if (isset($_GET['Id'])) {
  $id = $_GET['Id'];
}

$db = new db;
$sql = sprintf("SELECT * FROM happyhome WHERE Id = %s", GetSQLValueString($id, "int"));
$res = $db->query($sql);
$row = $db->fetch($res);

include('AdminPanel.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="50%"  border="0" align="center" cellpadding="5" cellspacing="0" class="table_border_grey" style="margin-top:10px;">
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Id:</td>
      <td><?php echo $row['Id']; ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">标题:</td>
      <td><?php echo $row['haphome_title']?></td>
    </tr>
    <tr valign="baseline">
      <td height="67" align="right" nowrap="nowrap">详细信息:</td>
      <td><?php echo $row['haphome_info'] ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">作者:</td>
      <td><?php echo $row['haphome_author'] ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">分类:</td>
      <td><?php echo getHappyHomeType($row['haphome_class']); ?></td>
  	</tr>
  	<tr valign="baseline">
      <td nowrap="nowrap" align="right">照片:</td>
      <td>
      <?php
      if($row['haphome_pic'] != NULL && $row['haphome_pic'] != '') {
      ?>
      <img src="<?php echo IMAGES_HAPPYHOME_FOLDER.$row['haphome_pic']; ?>" border="0" class="img_border">&nbsp;
      <?php
      }
      if($row['haphome_pic'] != NULL && $row['haphome_pic2'] != '') {
      ?>
      <img src="<?php echo IMAGES_HAPPYHOME_FOLDER.$row['haphome_pic2']; ?>" border="0" class="img_border">&nbsp;
      <?php
      }
      if($row['haphome_pic'] != NULL && $row['haphome_pic3'] != '') {
      ?>
      <img src="<?php echo IMAGES_HAPPYHOME_FOLDER.$row['haphome_pic3']; ?>" border="0" class="img_border">
  	  <?php
      }
      ?>
      </td>
  	</tr>
  	<tr>
	  	<td>&nbsp;</td>
	    <td><input type="button" id="button" onclick="javascript:history.go(-1);" value="<?php echo TEXT_BACK?>"></td>
	  </tr>
<p>&nbsp;</p>
</body>
</html>